package hku.cs.lunuo.rank;

import hku.cs.lunuo.Global;

public class StmtBasingModel extends BlkBasingModel {

	@Override
	protected void doAnalyze(BlkStatistic blkStatistic) {
		for (String klassName : blkStatistic.getKlassNames()) {
			for (String methodName : blkStatistic.getMethodNames(klassName)) {
				for (Integer idx : blkStatistic.getBlks(klassName, methodName)) {
					TFTimes tf = blkStatistic.getProperty(klassName, methodName, idx).tfs;
					VotedUnit u = new VotedUnit(new BlkUnit(klassName, methodName, idx),tf);
					VotedGlobal g = new VotedGlobal(blkStatistic.totaltf);
					Label label = Global.v().voter.vote(u, g);
					blkStatistic.setLabel(klassName, methodName, idx, label);
				}
			}
		}
	}

}
